|
@@ -43,10 +43,7 @@ import com.fs.company.domain.CompanyDept;
|
|
|
import com.fs.company.domain.CompanyMoneyLogs;
|
|
import com.fs.company.domain.CompanyMoneyLogs;
|
|
|
import com.fs.company.domain.CompanyUser;
|
|
import com.fs.company.domain.CompanyUser;
|
|
|
import com.fs.company.domain.*;
|
|
import com.fs.company.domain.*;
|
|
|
-import com.fs.company.mapper.CompanyDeptMapper;
|
|
|
|
|
-import com.fs.company.mapper.CompanyMapper;
|
|
|
|
|
-import com.fs.company.mapper.CompanyMoneyLogsMapper;
|
|
|
|
|
-import com.fs.company.mapper.CompanyTagMapper;
|
|
|
|
|
|
|
+import com.fs.company.mapper.*;
|
|
|
import com.fs.company.service.ICompanyDeptService;
|
|
import com.fs.company.service.ICompanyDeptService;
|
|
|
import com.fs.company.service.ICompanyService;
|
|
import com.fs.company.service.ICompanyService;
|
|
|
import com.fs.company.service.ICompanyUserService;
|
|
import com.fs.company.service.ICompanyUserService;
|
|
@@ -400,6 +397,9 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private IFsStoreCartScrmService fsStoreCartScrmService;
|
|
private IFsStoreCartScrmService fsStoreCartScrmService;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private CompanyUserUserMapper companyUserUserMapper;
|
|
|
|
|
+
|
|
|
@PostConstruct
|
|
@PostConstruct
|
|
|
public void initErpServiceMap() {
|
|
public void initErpServiceMap() {
|
|
|
erpServiceMap = new HashMap<>();
|
|
erpServiceMap = new HashMap<>();
|
|
@@ -4880,28 +4880,9 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private static final DateTimeFormatter CST_FORMATTER = DateTimeFormatter
|
|
|
|
|
- .ofPattern("EEE MMM dd HH:mm:ss zzz yyyy", Locale.US)
|
|
|
|
|
- .withZone(ZoneId.of("Asia/Shanghai"));
|
|
|
|
|
|
|
|
|
|
- private static final DateTimeFormatter STANDARD_FORMATTER = DateTimeFormatter
|
|
|
|
|
- .ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
|
|
|
|
|
- public static LocalDateTime parseCstToLocalDateTime(String cstDateStr) {
|
|
|
|
|
- if (cstDateStr == null || cstDateStr.trim().isEmpty()) {
|
|
|
|
|
- return null;
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
- try {
|
|
|
|
|
- // 解析为带时区的日期时间
|
|
|
|
|
- ZonedDateTime zonedDateTime = ZonedDateTime.parse(cstDateStr, CST_FORMATTER);
|
|
|
|
|
- // 转换为本地日期时间(忽略时区,仅保留年月日时分秒)
|
|
|
|
|
- return zonedDateTime.toLocalDateTime();
|
|
|
|
|
- } catch (DateTimeParseException e) {
|
|
|
|
|
- System.err.println("日期解析失败: " + e.getMessage());
|
|
|
|
|
- return null;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public List<FsStoreOrderVO> selectFsStoreOrderListVOByErpAccount(FsStoreOrderParam param) {
|
|
public List<FsStoreOrderVO> selectFsStoreOrderListVOByErpAccount(FsStoreOrderParam param) {
|
|
|
List<FsStoreOrderVO> list = fsStoreOrderMapper.selectFsStoreOrderListVOByErpAccount(param);
|
|
List<FsStoreOrderVO> list = fsStoreOrderMapper.selectFsStoreOrderListVOByErpAccount(param);
|
|
@@ -5159,10 +5140,7 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- @Override
|
|
|
|
|
- public List<FsStoreOrderDeliveryNoteExportVO> getDeliveryNote(FsStoreOrderParam param) {
|
|
|
|
|
- return fsStoreOrderMapper.getDeliveryNote(param);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@@ -5294,59 +5272,7 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- @Override
|
|
|
|
|
- @Transactional(rollbackFor = Throwable.class, propagation = Propagation.REQUIRED)
|
|
|
|
|
- public void refreshOrderSettlementStatus() {
|
|
|
|
|
- try {
|
|
|
|
|
- // 判断是否对接微信发货
|
|
|
|
|
- String json = configService.selectConfigByKey("store.config");
|
|
|
|
|
- StoreConfig config = JSONUtil.toBean(json, StoreConfig.class);
|
|
|
|
|
- logger.info("进入微信结算订单定时任务--------------->{}", "start");
|
|
|
|
|
- if (config != null && config.getIsWeChatShipping() != null && config.getIsWeChatShipping()) {
|
|
|
|
|
- // 获取未结算订单
|
|
|
|
|
- List<FsStoreOrderScrm> orderScrmList = fsStoreOrderMapper.getUnsettledOrder();
|
|
|
|
|
|
|
|
|
|
-// String payConfig = configService.selectConfigByKey("store.pay");
|
|
|
|
|
- String payConfig = configService.selectConfigByKey("his.pay");
|
|
|
|
|
- JSONObject js = JSON.parseObject(payConfig);
|
|
|
|
|
- String appId = js.getString("appId");
|
|
|
|
|
-
|
|
|
|
|
- if (ObjectUtil.isNotNull(appId) && !appId.isEmpty()) {
|
|
|
|
|
- final WxMaService wxService = WxMaConfiguration.getMaService(appId);
|
|
|
|
|
-
|
|
|
|
|
- if (!orderScrmList.isEmpty()) {
|
|
|
|
|
- for (FsStoreOrderScrm order : orderScrmList) {
|
|
|
|
|
- WxMaOrderShippingInfoGetRequest request = new WxMaOrderShippingInfoGetRequest();
|
|
|
|
|
- request.setTransactionId(order.getBankTransactionId());
|
|
|
|
|
- WxMaOrderShippingInfoGetResponse response;
|
|
|
|
|
-
|
|
|
|
|
- try {
|
|
|
|
|
- response = wxService.getWxMaOrderShippingService().get(request);
|
|
|
|
|
-
|
|
|
|
|
- if (response.getErrCode().equals(0)) {
|
|
|
|
|
- // 订单状态枚举:(1) 待发货;(2) 已发货;(3) 确认收货;(4) 交易完成;(5) 已退款
|
|
|
|
|
- if (response.getOrder().getOrderState().equals(3) || response.getOrder().getOrderState().equals(4)) {
|
|
|
|
|
- if (order.getStatus() == OrderInfoEnum.STATUS_2.getValue()) {
|
|
|
|
|
- this.finishOrder(order.getId());
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- logger.info("请求信息------------------------》{}", response);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- } catch (WxErrorException e) {
|
|
|
|
|
- logger.info("异常信息------------------------》{}", e.getMessage());
|
|
|
|
|
- continue;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- } catch (Exception e) {
|
|
|
|
|
- e.getStackTrace();
|
|
|
|
|
- } finally {
|
|
|
|
|
- logger.info("进入微信结算订单定时任务--------------->{}", "end");
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
private void batchUpdateDeliveryNotes(List<FsOrderDeliveryNoteDTO> list) {
|
|
private void batchUpdateDeliveryNotes(List<FsOrderDeliveryNoteDTO> list) {
|
|
|
int batchSize = 500;
|
|
int batchSize = 500;
|