|
@@ -22,6 +22,8 @@ import com.fs.store.param.*;
|
|
import com.fs.store.service.*;
|
|
import com.fs.store.service.*;
|
|
import com.fs.store.vo.FsUserShareVO;
|
|
import com.fs.store.vo.FsUserShareVO;
|
|
import com.fs.system.service.ISysConfigService;
|
|
import com.fs.system.service.ISysConfigService;
|
|
|
|
+import com.fs.wx.domain.FsWxExpressTask;
|
|
|
|
+import com.fs.wx.mapper.FsWxExpressTaskMapper;
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
import org.apache.commons.lang.ObjectUtils;
|
|
import org.apache.commons.lang.ObjectUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
@@ -34,6 +36,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
import java.text.ParseException;
|
|
import java.text.ParseException;
|
|
|
|
+import java.time.LocalDateTime;
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.Set;
|
|
import java.util.Set;
|
|
@@ -101,6 +104,15 @@ public class StoreTask {
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private IFsExpressService expressService;
|
|
private IFsExpressService expressService;
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ private IFsStorePaymentService fsStorePaymentService;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ private FsWxExpressTaskMapper fsWxExpressTaskMapper;
|
|
|
|
+
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 发货任务
|
|
* 发货任务
|
|
*/
|
|
*/
|
|
@@ -430,12 +442,16 @@ public class StoreTask {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 更新发货状态
|
|
* 更新发货状态
|
|
*/
|
|
*/
|
|
@QuartzRunnable(name = "发货任务")
|
|
@QuartzRunnable(name = "发货任务")
|
|
public void updateExpress() {
|
|
public void updateExpress() {
|
|
List<FsStoreOrder> list = fsStoreOrderMapper.selectUpdateExpress();
|
|
List<FsStoreOrder> list = fsStoreOrderMapper.selectUpdateExpress();
|
|
|
|
+ List<FsWxExpressTask> tasks = new ArrayList<>();
|
|
|
|
+
|
|
for (FsStoreOrder order : list) {
|
|
for (FsStoreOrder order : list) {
|
|
ErpOrderQueryRequert request = new ErpOrderQueryRequert();
|
|
ErpOrderQueryRequert request = new ErpOrderQueryRequert();
|
|
request.setCode(order.getExtendOrderId());
|
|
request.setCode(order.getExtendOrderId());
|
|
@@ -456,10 +472,34 @@ public class StoreTask {
|
|
delivery.getExpress_code(), delivery.getExpress_name());
|
|
delivery.getExpress_code(), delivery.getExpress_name());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ FsWxExpressTask fsWxExpressTask = new FsWxExpressTask();
|
|
|
|
+ fsWxExpressTask.setUserId(order.getUserId());
|
|
|
|
+ fsWxExpressTask.setStatus(0);
|
|
|
|
+ fsWxExpressTask.setRetryCount(0);
|
|
|
|
+ fsWxExpressTask.setCreateTime(LocalDateTime.now());
|
|
|
|
+ fsWxExpressTask.setUpdateTime(LocalDateTime.now());
|
|
|
|
+ fsWxExpressTask.setOrderCode(order.getOrderCode());
|
|
|
|
+
|
|
|
|
+ List<FsStorePayment> fsStorePayments = fsStorePaymentService.selectFsStorePaymentByOrderIdNew(order.getId());
|
|
|
|
+ if(CollectionUtils.isNotEmpty(fsStorePayments)){
|
|
|
|
+ FsStorePayment fsStorePayment = fsStorePayments.get(0);
|
|
|
|
+ fsWxExpressTask.setPayCode(fsStorePayment.getPayCode());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ tasks.add(fsWxExpressTask);
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ if(CollectionUtils.isNotEmpty(tasks)){
|
|
|
|
+ fsWxExpressTaskMapper.insertBatch(tasks);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|