|
@@ -23,6 +23,7 @@ import com.fs.his.utils.ConfigUtil;
|
|
|
import com.fs.hisStore.config.FsErpConfig;
|
|
import com.fs.hisStore.config.FsErpConfig;
|
|
|
import com.fs.hisStore.domain.*;
|
|
import com.fs.hisStore.domain.*;
|
|
|
import com.fs.hisStore.dto.FsStoreOrderComputeDTO;
|
|
import com.fs.hisStore.dto.FsStoreOrderComputeDTO;
|
|
|
|
|
+import com.fs.hisStore.enums.OrderAuditStateEnum;
|
|
|
import com.fs.hisStore.enums.OrderInfoEnum;
|
|
import com.fs.hisStore.enums.OrderInfoEnum;
|
|
|
import com.fs.hisStore.mapper.FsStorePaymentScrmMapper;
|
|
import com.fs.hisStore.mapper.FsStorePaymentScrmMapper;
|
|
|
import com.fs.hisStore.param.*;
|
|
import com.fs.hisStore.param.*;
|
|
@@ -59,6 +60,7 @@ import org.springframework.web.bind.annotation.*;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
|
import java.text.SimpleDateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
|
|
|
+import java.time.LocalDateTime;
|
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
|
|
|
@@ -71,7 +73,8 @@ public class StoreOrderScrmController extends AppBaseController {
|
|
|
private static final String STORE_PAY_CONF = "his.pay";
|
|
private static final String STORE_PAY_CONF = "his.pay";
|
|
|
|
|
|
|
|
Logger logger= LoggerFactory.getLogger(getClass());
|
|
Logger logger= LoggerFactory.getLogger(getClass());
|
|
|
-
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private IFsStoreOrderAuditScrmService orderAuditService;
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private WxMaProperties properties;
|
|
private WxMaProperties properties;
|
|
|
|
|
|
|
@@ -117,7 +120,8 @@ public class StoreOrderScrmController extends AppBaseController {
|
|
|
@Autowired
|
|
@Autowired
|
|
|
@Qualifier("k9OrderScrmServiceImpl")
|
|
@Qualifier("k9OrderScrmServiceImpl")
|
|
|
private IErpOrderService k9OrderService;
|
|
private IErpOrderService k9OrderService;
|
|
|
-
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private IFsStoreOrderAuditLogScrmService orderAuditLogService;
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private ConfigUtil configUtil;
|
|
private ConfigUtil configUtil;
|
|
|
//TODO 应该没用到
|
|
//TODO 应该没用到
|
|
@@ -429,6 +433,9 @@ public class StoreOrderScrmController extends AppBaseController {
|
|
|
storeOrder.setStatus(OrderInfoEnum.STATUS_1.getValue());
|
|
storeOrder.setStatus(OrderInfoEnum.STATUS_1.getValue());
|
|
|
storeOrder.setPayTime(new Date());
|
|
storeOrder.setPayTime(new Date());
|
|
|
orderService.updateFsStoreOrder(storeOrder);
|
|
orderService.updateFsStoreOrder(storeOrder);
|
|
|
|
|
+ // 添加订单审核
|
|
|
|
|
+ addOrderAudit(order);
|
|
|
|
|
+
|
|
|
return R.ok().put("payType",4);
|
|
return R.ok().put("payType",4);
|
|
|
}
|
|
}
|
|
|
// else if(order.getPayType().equals("3")){
|
|
// else if(order.getPayType().equals("3")){
|
|
@@ -445,9 +452,42 @@ public class StoreOrderScrmController extends AppBaseController {
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ private void addOrderAudit(FsStoreOrderScrm order) {
|
|
|
|
|
+ if (!getAuditSwitch()) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
+ FsStoreOrderAuditScrm orderAudit = new FsStoreOrderAuditScrm();
|
|
|
|
|
+ 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);
|
|
|
|
|
+
|
|
|
|
|
+ FsStoreOrderAuditLogScrm auditLog = new FsStoreOrderAuditLogScrm();
|
|
|
|
|
+ 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");
|
|
|
|
|
+ com.fs.hisStore.config.StoreConfig config = JSONUtil.toBean(json, com.fs.hisStore.config.StoreConfig.class);
|
|
|
|
|
+ return config.getAuditSwitch() == 1;
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
@Login
|
|
@Login
|
|
|
@ApiOperation("修改支付类型")
|
|
@ApiOperation("修改支付类型")
|